package com.dfqy.dao;

import com.dfqy.pojo.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;

/**
 * Author : atyushu
 * Package : com.dfqy.dao
 * ClassName : UserDao
 * Create : 2023/7/31 - 13:04
 * Version : v1.0
 * Description : The interface of dao for user.
 */
@Component
public interface UserDao {

    int insert(User user);

    int delete(@Param("id") long... id);

    int update(User user);

    User getById(@Param("id") long id);

    int countByLike(@Param("uname") String uname, @Param("phone") String phone, @Param("regtimeStart") Date regtimeStart, @Param("regtimeEnd") Date regtimeEnd, @Param("qq") String qq, @Param("weibo") String weibo);

    List<User> page(@Param("no") int pageNo, @Param("size") int pageSize, @Param("uname") String uname, @Param("phone") String phone, @Param("regtimeStart") Date regtimeStart, @Param("regtimeEnd") Date regtimeEnd, @Param("qq") String qq, @Param("weibo") String weibo);

    User signIn(@Param("uname") String uname, @Param("pass") String pass);

    int signUp(User user);

    int ban(@Param("id") long id);

    int restore(@Param("id") long id);

    int checkUname(@Param("uname") String uname);

    int checkPhone(@Param("phone") String phone);

    int reloadPass(@Param("id") long id, @Param("pass") String pass);
}